Database partitioning (or sharding) has been used for improving performance and scalability for both transactional and analytical application programs (hereinafter “applications”). Most of the major database vendors, such as IBM, Oracle, Microsoft and Pivotal, have support for database partitioning. There already exist many kinds of general-purpose partitioning schemes, among which round-robin, range-based, and hashing are the most widely deployed. More ad-hoc and flexible partitioning schemes tailored for specific-purpose applications have also been developed, such as Schism and the consistent hashing of Dynamo. However, selecting the most suitable scheme for a given application program places a heavy burden on the database administrator (DBA).